local shenyong = fk.CreateSkill {
  name = "lingling__shenyong",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["lingling__shenyong"] = "神勇",
  [":lingling__shenyong"] = "锁定技，若你没有手牌，摸牌阶段你多摸一张牌。你使用【杀】：次数上限+1；对每名角色每回合首次造成的伤害+1。",
}

shenyong:addEffect(fk.DrawNCards, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(shenyong.name) and player:isKongcheng()
  end,
  on_use = function (self, event, target, player, data)
    data.n = data.n + 1
  end,
})

shenyong:addEffect(fk.DamageCaused, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(shenyong.name) and
      data.card and data.card.trueName == "slash" and
      not table.contains(player:getTableMark("lingling__shenyong-turn"), data.to.id)
  end,
  on_use = function (self, event, target, player, data)
    player.room:addTableMark(player, "lingling__shenyong-turn", data.to.id)
    data:changeDamage(1)
  end,
})

shenyong:addEffect("targetmod", {
  residue_func = function (self, player, skill, scope, card, to)
    if player:hasSkill(shenyong.name) and card and card.trueName == "slash" and scope == Player.HistoryPhase then
      return 1
    end
  end,
})

shenyong:addLoseEffect(function (self, player, is_death)
  player.room:setPlayerMark(player, "lingling__shenyong-turn", 0)
end)

return shenyong
